{extend name="../../base/view/common/base" /}
{block name="style"}
{include file="/approve/add_style" /}
{/block}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">招聘需求审批</h3>
	{eq name="$id" value="0"}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">招聘部门<font>*</font></td>
			<td colspan="2">
				<select name="department_type" lay-verify="required" lay-reqText="请选择招聘部门">
					<option value="">--请选择--</option>
					{volist name=":get_department()" id="vo"}
					<option value="{$vo.id}">{$vo.title}</option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray-2">期望到岗日期<font>*</font></td>
			<td colspan="2">
				<input id="detail_time" name="detail_time" autocomplete="off" readonly class="layui-input" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">招聘岗位<font>*</font></td>
			<td colspan="2">
				<select name="position_type" lay-verify="required" lay-reqText="请选择担任职务">
					<option value="">--请选择--</option>
					{volist name=":get_position()" id="vo"}
					<option value="{$vo.id}">{$vo.title}</option>
					{/volist}
				</select>			
			</td>
			<td class="layui-td-gray">招聘人数<font>*</font></td>
			<td colspan="2">
				<input name="num" autocomplete="off" class="layui-input" value="" lay-verify="required" placeholder="请输入招聘人数" lay-reqText="请输入招聘人数">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">岗位职责<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入岗位职责" class="layui-textarea" lay-verify="required" lay-reqText="请输入岗位职责"></textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">任职要求<font>*</font></td>
			<td colspan="5">
				<textarea name="remark" placeholder="请输入任职要求" class="layui-textarea" lay-verify="required" lay-reqText="请输入任职要求"></textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5" style="line-height:inherit">
				<div class="layui-row" id="fileList">
					<input type="hidden" data-type="file" name="file_ids" value="">
				</div>
			</td>
		</tr>
	</table>
	{else/}
	<table class="layui-table layui-table-form">
		<tr>
			<td class="layui-td-gray-2">招聘部门<font>*</font></td>
			<td colspan="2">
				<select name="department_type" lay-verify="required" lay-reqText="请选择招聘部门">
					<option value="">--请选择--</option>
					{volist name=":get_department()" id="vo"}
					<option value="{$vo.id}" {eq name="$vo.id" value="$detail.department_type"}selected=""{/eq}>{$vo.title}</option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray-2">期望到岗日期<font>*</font></td>
			<td colspan="2">
				<input id="detail_time" name="detail_time" autocomplete="off" readonly class="layui-input" value="{$detail.detail_time}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">招聘岗位<font>*</font></td>
			<td colspan="2">
				<select name="position_type" lay-verify="required" lay-reqText="请选择担任职务">
					<option value="">--请选择--</option>
					{volist name=":get_position()" id="vo"}
					<option value="{$vo.id}" {eq name="$vo.id" value="$detail.position_type"}selected=""{/eq}>{$vo.title}</option>
					{/volist}
				</select>			
			</td>
			<td class="layui-td-gray">招聘人数<font>*</font></td>
			<td colspan="2">
				<input name="num" autocomplete="off" class="layui-input" value="{$detail.num}" lay-verify="required" placeholder="请输入招聘人数" lay-reqText="请输入招聘人数">
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">岗位职责<font>*</font></td>
			<td colspan="5">
				<textarea name="content" placeholder="请输入岗位职责" class="layui-textarea" lay-verify="required" lay-reqText="请输入岗位职责">{$detail.content}</textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray">任职要求<font>*</font></td>
			<td colspan="5">
				<textarea name="remark" placeholder="请输入任职要求" class="layui-textarea" lay-verify="required" lay-reqText="请输入任职要求">{$detail.remark}</textarea>
			</td>
		</tr>
		<tr>
			<td class="layui-td-gray"><div class="layui-input-inline">附件</div> <div class="layui-input-inline"><button type="button" class="layui-btn layui-btn-xs" id="upFile"><i class="layui-icon"></i></button></div></td>
			<td colspan="5" style="line-height:inherit">
				<div class="layui-row" id="fileList">
					<input type="hidden" name="file_ids" data-type="file" value="{$detail.file_ids}">
					{notempty name="$detail.file_ids"}
					{volist name="$detail.fileArray" id="vo"}
					<div class="layui-col-md4" id="uploadImg{$vo.id}">{:file_card($vo)}</div>
					{/volist}
					{/notempty}
				</div>
			</td>
		</tr>
	</table>
	{/eq}
	{include file="/approve/add_flow" /}
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker','oaTool'];
	function gouguInit() {
		var form = layui.form,
			tool=layui.tool,
			oaTool=layui.oaTool,
			laydate = layui.laydate;
			
		oaTool.addFile({
			btn: 'upFile',
			box: 'fileList'
		});	

		if (typeof (flowStep) == "function") {
			flowStep();
		}
		  
		//日期时间范围
		laydate.render({
			elem: '#detail_time',
			type: 'date',
			format: 'yyyy-MM-dd',
			showBottom: false
		});
		
	}
</script>
{/block}
<!-- /脚本 -->